home *** CD-ROM | disk | FTP | other *** search
/ 3D World 113 / 3DW_113.iso / pc / Menu / Scenes / home.dir / Internal_6_Main Button Rollover.ls < prev    next >
Encoding:
Text File  |  2008-09-12  |  4.0 KB  |  131 lines

  1. property Sp, myPath, myListEntry, myTitle, myToolTip
  2. global rollcolor, gFullPath, gRootPath, gDiv, finalChan, gMenuList, SectionPath, SectionNumber
  3.  
  4. on Initialize me, aNumber, aAction, aListEntry, aItemTitle
  5.   Sp = sprite(aNumber)
  6.   myPath = aAction
  7.   myTitle = aItemTitle
  8.   myListEntry = aListEntry
  9.   myToolTip = EMPTY
  10.   case myPath.char[1] of
  11.     "[":
  12.       myToolTip = "Click here to go online..."
  13.   end case
  14. end
  15.  
  16. on mouseEnter me
  17.   cursor(280)
  18.   Sp.member = member("main_over", "GFX")
  19.   if myToolTip <> EMPTY then
  20.     member("tooltip_back").regPoint = point(0, 0)
  21.     lc = _movie.channel.count
  22.     tipLoc = Sp.loc + point(0, 30)
  23.     channel(lc - 1).makeScriptedSprite(member("tooltip_back"), tipLoc)
  24.     if myToolTip <> EMPTY then
  25.       member("tooltip_text").text = myToolTip
  26.     else
  27.       member("tooltip_text").text = "Click to go online..."
  28.     end if
  29.     channel(lc).makeScriptedSprite(member("tooltip_Text"), tipLoc + point(5, 1))
  30.     sprite(lc).ink = 36
  31.   end if
  32. end
  33.  
  34. on mouseLeave me
  35.   Sp.member = member("main_button", "gfx")
  36.   lc = _movie.channel.count
  37.   channel(lc - 1).removeScriptedSprite()
  38.   channel(lc).removeScriptedSprite()
  39.   cursor(-1)
  40.   Sp.color = rgb(0, 0, 0)
  41. end
  42.  
  43. on mouseUp me
  44.   repeat with i = finalChan to _movie.channel.count
  45.     channel(i).removeScriptedSprite()
  46.   end repeat
  47.   if myPath.char[1] = "<" then
  48.     pmarker = myPath.char[2..myPath.char.count - 1]
  49.     go(marker(pmarker))
  50.   else
  51.     if myPath.char[1] = "[" then
  52.       pURL = myPath.char[2..myPath.char.count - 1]
  53.       gotoNetPage(pURL)
  54.     else
  55.       if myPath.char[1] = "{" then
  56.         pMovieTarget = myPath.char[2..myPath.char.count - 1]
  57.         go(1, gRootPath & "menu" & gDiv & "Scenes" & gDiv & pMovieTarget)
  58.       else
  59.         if myPath.char[1] = "(" then
  60.           pLinkTarget = myPath.char[2..myPath.char.count - 1]
  61.           theLink = pathReplace(gRootPath & "DiscContent" & gDiv & pLinkTarget)
  62.           put theLink
  63.           gotoNetPage("file:///" & theLink)
  64.         else
  65.           if myPath contains "gallery" then
  66.             pmarker = "gallery"
  67.             SectionNumber = myListEntry
  68.             gFullPath = gRootPath & "DiscContent" & gDiv & gMenuList[myListEntry].ItemPath & gDiv
  69.             go(marker(pmarker))
  70.           else
  71.             grabDetails()
  72.           end if
  73.         end if
  74.       end if
  75.     end if
  76.   end if
  77. end
  78.  
  79. on pathReplace aPath
  80.   ret = EMPTY
  81.   if the platform contains "mac" then
  82.     repeat with i = 1 to aPath.char.count
  83.       if aPath.char[i] = ":" then
  84.         ret = ret & "/"
  85.         next repeat
  86.       end if
  87.       ret = ret & aPath.char[i]
  88.     end repeat
  89.     return ret
  90.   else
  91.     ret = ret & gRootPath.char[1..2]
  92.     repeat with i = 3 to aPath.char.count
  93.       if aPath.char[i] = ":" then
  94.         ret = ret & "/"
  95.         next repeat
  96.       end if
  97.       ret = ret & aPath.char[i]
  98.     end repeat
  99.     return ret
  100.   end if
  101. end
  102.  
  103. on grabDetails
  104.   member("SectionTitle").text = myTitle
  105.   pLine = 1
  106.   lH = 20
  107.   lV = 225
  108.   SectionPath = gMenuList[myListEntry].ItemPath
  109.   SectionNumber = myListEntry
  110.   if gMenuList[myListEntry].ItemList.count > 0 then
  111.     fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & gMenuList[SectionNumber].ItemList[1].ItemPath & gDiv
  112.     gFullPath = fullPath
  113.     generateProductPage(fullPath)
  114.     repeat with i = 1 to the number of castMembers of castLib "SubItems"
  115.       if member(i, "subItems").name contains myTitle then
  116.         channel(finalChan + pLine).removeScriptedSprite()
  117.         channel(finalChan + pLine).makeScriptedSprite(member(i, "subItems"), point(lH, lV))
  118.         sprite(finalChan + pLine).scriptInstanceList = []
  119.         add(sprite(finalChan + pLine).scriptInstanceList, new(script("Sub_Item_Rollover"), 1))
  120.         _movie.sendSprite(finalChan + pLine, #Initialize, finalChan + pLine, pLine)
  121.         sprite(finalChan + pLine).ink = 36
  122.         lV = lV + 25
  123.         pLine = pLine + 1
  124.       end if
  125.     end repeat
  126.     fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & gMenuList[SectionNumber].ItemList[1].ItemPath & gDiv
  127.     gFullPath = fullPath
  128.     go(marker("software"))
  129.   end if
  130. end
  131.